<template>
    <div class="child">
        <h2>我是Child组件</h2>
        <h3>当前求和为: {{ sum }}</h3>
        <p>{{ xx }}</p>
        <!-- <p>{{ xy }}</p> -->
        <p>{{ content }} content </p> 
    </div>    
</template>


<script setup lang="ts" name = "child">
import { ref} from 'vue';
import axios from 'axios';
let sum = ref(0)

let xx = axios.get('https://api.uomg.com/api/rand.qinghua?format=json')
console.log(xx)

/*
let content =ref('')
axios.get('https://api.uomg.com/api/rand.qinghua?format=json').then((res)=>{
    console.log(res.data)    
    content = res?.data?.content
})
*/

let {data:{content}} = await axios.get('https://api.uomg.com/api/rand.qinghua?format=json')
console.log("content ",content)

// https://api.uomg.com/api/rand.qinghua?format=json


</script>

<style lang="scss" scoped>
.child {
    background-color: #ddd;
    border-radius: 10px;
    padding: 10px;
    box-shadow: 0 0 10px;   
}
</style>